Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enable AscendC kernel operator #3614

Merged
merged 2 commits into from
Feb 29, 2024
Merged

Enable AscendC kernel operator #3614

merged 2 commits into from
Feb 29, 2024

Conversation

hipudding
Copy link
Contributor

AscendC is an extended syntax for the C/C++ language that can be used to write operators that run on Ascend NPU.

This commit introduce an operator(threshold) written in AscendC. Others can refer to this to implement other operators.

AscendC can implement efficient fusion operators according to needs, in this case, threshold execution speed increased by nearly 4 times.

Pull Request Readiness Checklist

See details at https://github.com/opencv/opencv/wiki/How_to_contribute#making-a-good-pull-request

  • I agree to contribute to the project under Apache 2 License.
  • To the best of my knowledge, the proposed patch is not based on a code under GPL or another license that is incompatible with OpenCV
  • The PR is proposed to the proper branch
  • N/A There is a reference to the original bug report and related work
  • There is accuracy test, performance test and test data in opencv_extra repository, if applicable
    Patch to opencv_extra has the same branch name.
  • The feature is well documented and sample code can be built with the project CMake

@hipudding
Copy link
Contributor Author

hipudding commented Dec 28, 2023

This PR needs cann 7.0.0.alpha003 or above.
opencv-infrastructure/opencv-gha-dockerfile#28
opencv/ci-gha-workflow#132

AscendC is an extended syntax for the C/C++ language that can be used to
write operators that run on Ascend NPU.

This commit introduce an operator(threshold) written in AscendC. Others
can refer to this to implement other operators.

AscendC can implement efficient fusion operators according to needs, in
this case, threshold execution speed increased by nearly 4 times.

Co-authored-by: CaoMengqing <[email protected]>
1. remove threshold_opencv_kernel
2. typo ASCENDC_KERNELS_H
3. add ALIGN_UP macro
@hipudding
Copy link
Contributor Author

@vpisarev Please help me add category: cann tag to run test cases, Thanks.

@asmorkalov asmorkalov merged commit bbce2ef into opencv:4.x Feb 29, 2024
9 of 10 checks passed
@asmorkalov asmorkalov mentioned this pull request Mar 6, 2024
@asmorkalov asmorkalov mentioned this pull request Apr 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants